# -*- coding: utf-8 -*- 
# @project : 《Atcoder》
# @Author : created by bensonrachel on 2021/12/12
# @File : 231.D - Neighbors1.py
# 拓扑排序判断是否有环，跟有向图有区别，度要加一
from collections import deque
n,m = map(int,input().split())
if m ==0:
    print("Yes")
    exit()
d = dict()
l = [list() for i in range(n+1)]
degree = [0]*(n+1)
for i in range(m):
    a,b = map(int,input().split())
    if a in d.keys():
        d[a] += 1
    else:
        d[a] = 1
    if b in d.keys():
        d[b] += 1
    else:
        d[b] = 1
    l[a].append(b)
    l[b].append(a)
    degree[b] += 1
    degree[a] += 1
dd = sorted(d.items(),key= lambda x : x[1])
ans = dd[-1][1]
Q = deque()
# print(degree)
for i in d.keys():
    if degree[i]==1:
        Q.append(i)
# print(Q)
if ans> 2:
    print("No")
else:
    tag = 0
    for i in d.keys():
        if d[i] == 1:
            tag = 1
    if tag == 1:
        while Q:
            u = Q.pop()  # 出队顺序无所谓，拓扑排序不唯一
            # tp.append(u)  # 加入到拓扑序列记录数组中
            for v in l[u]:  # 所有以u为尾的边指向的节点的入度都要减一，有向边没箭头那端为尾
                degree[v] -= 1
                if degree[v] == 1:  # 新的变成了入度为0的入队
                    Q.append(v)
        tag1 = 0
        for i in range(n+1):
            if degree[i] == 2:
                tag1 = 1
        if tag1 == 1:
            print("No")
            # print(degree)
        else:
            print("Yes")
            # print(degree)
    else:
        print("No")
